Skip to content

Conversation

@gengur
Copy link
Contributor

@gengur gengur commented Oct 5, 2025

issue: #263

@gengur gengur requested review from HagarMeir and tock-ibm October 5, 2025 12:59
@gengur gengur changed the title Metrics in logs - Assembler #263 Metrics in logs - Assembler Oct 5, 2025
@gengur gengur force-pushed the assembler_metrics_to_file branch 3 times, most recently from be90f40 to 56d720e Compare October 5, 2025 17:39
@gengur gengur force-pushed the assembler_metrics_to_file branch from 56d720e to 4aa4e3d Compare October 8, 2025 06:10
@gengur gengur force-pushed the assembler_metrics_to_file branch 2 times, most recently from 8612078 to 58e032d Compare October 8, 2025 07:33
@gengur gengur force-pushed the assembler_metrics_to_file branch 2 times, most recently from 7f9b131 to 5065ea1 Compare October 8, 2025 11:35
@gengur gengur force-pushed the assembler_metrics_to_file branch 4 times, most recently from 633acae to 5bebcab Compare October 9, 2025 14:22
@gengur gengur force-pushed the assembler_metrics_to_file branch from 5bebcab to e0ef3e2 Compare October 15, 2025 15:30
@gengur gengur force-pushed the assembler_metrics_to_file branch 2 times, most recently from 6807b2e to 60cc424 Compare October 21, 2025 09:23
@gengur gengur force-pushed the assembler_metrics_to_file branch from 60cc424 to 392db26 Compare October 30, 2025 10:51
@gengur gengur force-pushed the assembler_metrics_to_file branch from 392db26 to 61f1d7f Compare November 2, 2025 11:09
@gengur gengur force-pushed the assembler_metrics_to_file branch 3 times, most recently from 839e81b to 5a1178b Compare November 6, 2025 11:42
@HagarMeir HagarMeir force-pushed the assembler_metrics_to_file branch from 5a1178b to 000c7b2 Compare November 6, 2025 15:52
func (l *AssemblerLedger) GetTxCount() uint64 {
c := atomic.LoadUint64(&l.transactionCount)
return c
func (l *AssemblerLedger) GetBlocksCount() uint64 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block count is the height, why do we need another method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assembler_role contains the ledger that implements the AssemblerLedgerWrite interface, which does not expose the height.

@gengur gengur force-pushed the assembler_metrics_to_file branch 8 times, most recently from c84e482 to 018df9c Compare November 11, 2025 08:54

This comment was marked as resolved.

}

func (m *Metrics) trackMetrics() {
lastTxCommitted, lastBlocksCommitted := uint64(0), uint64(0)

This comment was marked as resolved.

blocksCommitted := atomic.LoadUint64(&m.ledgerMetrics.BlocksCount)
blocksSizeCommitted := atomic.LoadUint64(&m.ledgerMetrics.BlocksSize)

m.logger.Infof("ASSEMBLER_METRICS: total committed transactions %d, new transactions in the last %.2f seconds: %d, total blocks: %d, new blocks in the last: %.2f seconds: %d, total size: %d, prefetch buffer size: %d(%s) bytes",

This comment was marked as resolved.

return NewAssemblerLedger(logger, ledgerPath)
}

type AssemblerLedgerMetrics struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put it in a new file, it will be the prometheus metrics in the next PR, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right

return nil, fmt.Errorf("error while fetching last block from ledger %w", err)
}
_, _, transactionCount, err = AssemblerBatchIdOrderingInfoAndTxCountFromBlock(block)
_, _, alm.TransactionCount, err = AssemblerBatchIdOrderingInfoAndTxCountFromBlock(block)

This comment was marked as resolved.

if err := l.Ledger.Append(configBlock); err != nil {
panic(err)
}
atomic.AddUint64(&l.metrics.BlocksCount, uint64(1))

This comment was marked as resolved.

metrics PartitionPrefetchIndexMetrics
}

type PartitionPrefetchIndexMetrics [2]*uint64

This comment was marked as resolved.

@tock-ibm tock-ibm force-pushed the assembler_metrics_to_file branch from 018df9c to 10ae0f3 Compare November 13, 2025 09:40
Signed-off-by: Genady Gurevich <[email protected]>
@gengur gengur force-pushed the assembler_metrics_to_file branch from 10ae0f3 to 7cde6d0 Compare November 17, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants